/*
 * @Description: 获取登录信息
 * @Author: Liu Zhiwang
 * @Date: 2021-03-27 14:34:23
 * @LastEditTime: 2022-06-23 14:16:30
 * @LastEditors: zhangweili zhang_weili@uxsino.com
 */
import Cookies from 'js-cookie'
const TokenKey = 'token'

export function getToken() {
  return Cookies.get(TokenKey) || localStorage.getItem('TokenKey')
}

export function setToken(token) {
  localStorage.setItem('TokenKey', token)
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getUserInfo() {
  return Cookies.get('userInfo') && JSON.parse(Cookies.get('userInfo')) || JSON.parse(localStorage.getItem('userInfo'))
}
